package com.cy.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cy.common.pojo.JsonResult;
import com.cy.common.pojo.SysPage;
import com.cy.sys.pojo.SysLog;
import com.cy.sys.service.SysLogService;

/**
 * 此模块处理日志加载的请求
 * @author private
 *
 */
@RestController
@RequestMapping("/log/")
public class SysLogController {
	@Autowired
	private SysLogService sysLogService;
	
	/** 处理请求分页数据 */
	@RequestMapping("doFindPagesObjects")
	public JsonResult doFindPagesObjects(String username,Integer pageCurrent,Integer pageSize) {
		SysPage<SysLog> pageObjects = sysLogService.findPageObjects(username, pageCurrent,pageSize);
		return new JsonResult(pageObjects);
	}
	
	/** 处理请求删除数据 */
	@RequestMapping("doDeleteObject")
	public JsonResult doDeleteObject(Integer... ids) {
		sysLogService.deleteObjects(ids);
		return new JsonResult("delete ok");
	}
}
